package com.dongjiantong.farmrecords.mapper;

import com.dongjiantong.farmrecords.model.FarmRecordsHarmlesses;
import com.dongjiantong.mybatis.MyMapper;

import java.util.List;
import java.util.Map;

public interface FarmRecordsHarmlessesMapper extends MyMapper<FarmRecordsHarmlesses> {

    /**
     * 根据单据前缀查找表中最大单据号
     * @param prefix
     * @return
     */
    String findMaxNumber(String prefix);

    /**
     * 新增非集中处理无害化单据id
     * @param farmrecordsHarmlesses
     * @return
     */
    int createOne(FarmRecordsHarmlesses farmrecordsHarmlesses);

    /**
     * 根据养殖场ids,起止时间或者状态查询非集中无害化处理记录 (条件都可以为空,表示查询所有)
     * @param map
     * @return  Response<PageInfo<FarmRecordsHarmlesses>>
     */
    List<FarmRecordsHarmlesses> selectByMap(Map<String, Object> map);

    /**
     * 养殖端按照单据状态分页查询列表
     * @param map
     * @return
     */
    List<FarmRecordsHarmlesses> selectListByStatus(Map<String, Object> map);

    /**
     * 根据牛档案关联id 查询对应非集中处理无害化记录
     * @param map
     * @return
     */
    FarmRecordsHarmlesses selectOneByMap(Map<String, Object> map);

    List<Map<String,Object>> selectHarmlessesNoCenterCount(Map<String,Object> map);

    List<Map<String,Object>> findAWeekSum(Map<String, Object> paramsMap);
}